package com.qf.cqut.result;

import lombok.Data;

@Data
public class ResponseData<T> {
    //状态码
    private String code;
    //返回的消息
    private String msg;
    //返回的数据
    private T data;
    //分页需要的数据总量
    private Integer count;

    public ResponseData(){
    }



    public ResponseData(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public ResponseData(ResponseCode responseCode, T data) {
        this.code = responseCode.getCode();
        this.msg = responseCode.getMsg();
        this.data = data;
    }

    public ResponseData(ResponseCode responseCode, Integer count, T data) {
        this.code = responseCode.getCode();
        this.msg = responseCode.getMsg();
        this.data = data;
        this.count=count;
    }

    public ResponseData(String code,String msg){
        this.code=code;
        this.msg=msg;
    }
    public ResponseData(ResponseCode responseCode ) {
        this.code = responseCode.getCode();
        this.msg = responseCode.getMsg();
    }
}
